package com.ruoyi.stuinfo.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.stuinfo.mapper.AccommodationMapper;
import com.ruoyi.stuinfo.domain.Accommodation;
import com.ruoyi.stuinfo.service.IAccommodationService;

/**
 * 住宿分配Service业务层处理
 *
 * @author zc
 * @date 2025-05-14
 */
@Service
public class AccommodationServiceImpl implements IAccommodationService
{
    @Autowired
    private AccommodationMapper accommodationMapper;

    /**
     * 查询住宿分配
     *
     * @param accommodationId 住宿分配主键
     * @return 住宿分配
     */
    @Override
    public Accommodation selectAccommodationByAccommodationId(Long accommodationId)
    {
        return accommodationMapper.selectAccommodationByAccommodationId(accommodationId);
    }

    /**
     * 查询住宿分配列表
     *
     * @param accommodation 住宿分配
     * @return 住宿分配
     */
    @Override
    public List<Accommodation> selectAccommodationList(Accommodation accommodation)
    {
        return accommodationMapper.selectAccommodationList(accommodation);
    }

    /**
     * 新增住宿分配
     *
     * @param accommodation 住宿分配
     * @return 结果
     */
    @Override
    public int insertAccommodation(Accommodation accommodation)
    {
        return accommodationMapper.insertAccommodation(accommodation);
    }

    /**
     * 修改住宿分配
     *
     * @param accommodation 住宿分配
     * @return 结果
     */
    @Override
    public int updateAccommodation(Accommodation accommodation)
    {
        return accommodationMapper.updateAccommodation(accommodation);
    }

    /**
     * 批量删除住宿分配
     *
     * @param accommodationIds 需要删除的住宿分配主键
     * @return 结果
     */
    @Override
    public int deleteAccommodationByAccommodationIds(Long[] accommodationIds)
    {
        return accommodationMapper.deleteAccommodationByAccommodationIds(accommodationIds);
    }

    /**
     * 删除住宿分配信息
     *
     * @param accommodationId 住宿分配主键
     * @return 结果
     */
    @Override
    public int deleteAccommodationByAccommodationId(Long accommodationId)
    {
        return accommodationMapper.deleteAccommodationByAccommodationId(accommodationId);
    }

    @Override
    public List<Accommodation> selectAccommodationList_handteacher(String teacherId) {
        return accommodationMapper.selectAccommodationList_handteacher(teacherId);
    }
}
